/*
Copyright (C) 2013 Jesper Berent Nygaard Pedersen

Permission is hereby granted, free of charge, to any person obtaining a copy of this software
and associated documentation files (the "Software"), to deal in the Software without restriction,
including without limitation the rights to use, copy, modify, merge, publish, distribute,
sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or
substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include <stdint.h>

#ifdef WIN32
// These are used while testing under Windows
#define DATA_PATH "C:\\home\\stokermon\\data"
#define JSON_FILE "C:\\home\\stokermon\\pages\\tmp\\data.json"
#else
// The JSON output file should preferably go to a tmpfs in order to not wear down the
// disk/flash storage. Create a sym-link to the file from where the web pages are located.
#define JSON_FILE "/tmp/data.json"

// The database created by stokermon_dmn
#define DATA_PATH "/home/root/stokermon/data"
#define O_BINARY 0 // linux doesn't distinguish between binary and text files
#endif

// Data is stored in this structure. It could be reduced to save disk space (e.g. many of the
// parameters would fit into 8 bits) but storage is cheat, so what the f***.
struct t_dataset {
	struct timeval  time;
	uint32_t drift_effekt;
	uint32_t setup_effekt;
	uint32_t temp_kedel;
	uint32_t temp_skakt;
	uint32_t temp_roeg;
	uint32_t ilt;
	uint32_t lys;
	uint32_t snegl_sek;
	uint32_t el_sek;
	uint32_t alarm;
	uint32_t ref_kedel;
	uint32_t ref_ilt;
	uint32_t kapacitet;
	uint32_t skorsten;
	uint32_t maetning_lav;
	uint32_t maetning_hoj;
	uint32_t tilstand;
	uint32_t styringstype;
	}; // 80 bytes

